package com.zst.bluetooth.bean;

import com.litesuits.orm.db.annotation.Column;
import com.litesuits.orm.db.annotation.PrimaryKey;
import com.litesuits.orm.db.annotation.Table;
import com.litesuits.orm.db.enums.AssignType;

import org.joda.time.DateTime;

/**
 * 消息类
 * Created by zhang on 2016/1/6 0006.
 */
@Table("BlueMessage")
public class BlueMessage {
    @PrimaryKey(AssignType.AUTO_INCREMENT)
    private int id;
    @Column("createTime")
    public long createTime = DateTime.now().getMillis();
    @Column("content")
    public String content = "";
    @Column("state")
    public State state = State.STATE_PRE_SEND;
    @Column("belong")
    public String belong = "";
    @Column("sender")
    public String sender = "";
    @Column("type")
    public Type type = Type.TYPE_TASK;

    public enum Type {
        /**
         * 任务类型
         */
        TYPE_TASK,
        /**
         * 短信类型
         */
        TYPE_SMS
    }

    public enum State {
        /**
         * 发送前
         */
        STATE_PRE_SEND,
        /**
         * 发送中
         */
        STATE_SENDING,
        /**
         * 发送成功
         */
        STATE_SEND_SUCCESS,
        /**
         * 发送失败
         */
        STATE_SEND_FAIL
    }

    @Override
    public String toString() {
        return "BlueMessage{" +
                "createTime=" + createTime +
                ", content='" + content + '\'' +
                ", state=" + state +
                ", belong=" + belong +
                '}';
    }
}
